// 采购相关
import fetch from '@/config/fetch'

// 获取采购单列表
export const getBuyList = data => fetch('/purchase/purchase_list/', data);
// 查看采购单详情
export const infoBuy = (id, data) => fetch("/purchase/"+ id +"/purchase_single/", data);
// 新增采购单
export const addBuy = data => fetch('/purchase/purchase_add/', data, 'POST');
// 编辑采购单
export const editBuy = (id, data) => fetch("/purchase/"+ id +"/purchase_update/", data, 'PUT');
// 删除采购单
export const removeBuy = (id, data) => fetch("/purchase/"+ id +"/purchase_del/", data, 'DELETE');
// 批量删除采购单
export const removeBatchBuy = data => fetch('/purchase/purchase_batch_del/', data, 'POST');

// 获取采购退单列表
export const listBuyReturns = data => fetch('/return/return_list/', data);
// 查看采购退单详情
export const infoBuyReturns = (id, data) => fetch("/return/"+ id +"/return_single/", data);
// 新增采购退单
export const addBuyReturns = data => fetch('/return/return_add/', data, 'POST');
// 编辑采购退单
export const editBuyReturns = (id, data) => fetch("/return/"+ id +"/return_update/", data, 'PUT');
// 删除采购退单
export const removeBuyReturns = (id, data) => fetch("/return/"+ id +"/return_del/", data, 'DELETE');
// 批量删除采购退单
export const removeBatchBuyReturns = data => fetch('/return/return_batch_del/', data, 'POST');

// 获取采购预定列表
export const getBuyReserveList = data => fetch('/reserve_purchase/reserve_list/', data);
// 查看采购预定详情
export const getBuyReserveInfo = (id, data) => fetch("/reserve_purchase/"+ id +"/reserve_single/", data);
// 新增采购预定
export const addBuyReserve = data => fetch("/reserve_purchase/reserve_add/", data, 'POST');
// 编辑采购预定
export const editBuyReserve = (id, data) => fetch("/reserve_purchase/"+ id +"/reserve_update/", data, 'PUT');
// 取消采购预定
export const cancelBuyReserve = (id, data) => fetch("/reserve_purchase/"+ id +"/reserve_cancel/", data, 'POST');
// 删除采购预定
export const removeBuyeReserve = (id, data) => fetch("/reserve_purchase/"+ id +"/reserve_del/", data, 'DELETE');
// 批量删除采购预定
export const removeBatchBuyeReserve = data => fetch('/reserve_purchase/reserve_batch_del/', data, 'POST');

// 批量添加发票
export const addInvoices = data => fetch('/purchase/order_update_invoice/', data, 'POST');
// 查询采购最新的批次名称
export const getLastestBatchName = data => fetch('/batch_date_record/query_pu_latest_batch_name/', data);
